n, m, x = map(int, input().split())
a = [0] + list(map(int, input().split()))
for i in range(m):
    l, r = map(int, input())
    for b in a[l:r + 1]:
        for c in a[l:r + 1]:
            if b ^ c == x:
                print('yes')
            else:
                print('no')
